﻿using System;
using System.ServiceModel;
using Ayatta.Contract.Component;
using Ayatta.Contract.Domain;
using System.Collections.Generic;

namespace Ayatta.Contract
{
    [ServiceContract(Namespace = ServiceContract.Namespace)]
    public interface IPaymentService : IService
    {
        #region UserAccount

        [OperationContract]
        UserAccount GetUserAccount(long id);

        //[OperationContract]
        //PagedList<UserRecharge> GetPagedUserRecharge(long? userId = null, byte? status = null, int index = 1,int size = 20);

        #endregion

        #region UserTrade
        [OperationContract]
        bool CreateUserTrade(UserTrade o);

        [OperationContract]
        UserTrade GetUserTrade(string id, int? userId = null);

        [OperationContract]
        bool UpdateUserTrade(UserTrade o);

        #endregion

        #region UserPointDetail

        [OperationContract]
        bool CreateUserIntegral(UserIntegral o);

        [OperationContract]
        bool UpdateUserIntegral(UserIntegral o);

        [OperationContract]
        bool DeleteUserIntegral(int id);

        [OperationContract]
        UserIntegral GetUserIntegral(int id);

        [OperationContract]
        PagedList<UserIntegral> GetPagedUserIntegral(long? userId = null, IntegralCategory? category = null,
                                                  IntegralStatus? status = null, int index = 1, int size = 20);

        #endregion

        #region PaymentBank

        [OperationContract]
        bool CreatePaymentBank(PaymentBank o);

        [OperationContract]
        bool UpdatePaymentBank(PaymentBank o);

        [OperationContract]
        bool DeletePaymentBank(int id);

        [OperationContract]
        PaymentBank GetPaymentBank(int id);

        [OperationContract]
        IList<PaymentBank> GetAllPaymentBank();

        [OperationContract]
        IDictionary<int, string> GetAvailablePaymentBank(int platformId);

        [OperationContract]
        PagedList<PaymentBank> GetPagedPaymentBank(int index = 1, int size = 20, string name = null, bool? status = null);

        #endregion

        #region PaymentEBank

        [OperationContract]
        bool CreatePaymentEBank(PaymentEBank o);

        [OperationContract]
        bool UpdatePaymentEBank(PaymentEBank o);

        [OperationContract]
        bool DeletePaymentEBank(int id);

        [OperationContract]
        PaymentEBank GetPaymentEBank(int id, bool widthDetail = false);

        [OperationContract]
        IList<PaymentEBank> GetAllPaymentEBank(int? platformId = null, bool? status = null, string name = null);

        #endregion

        #region PaymentPlatform

        [OperationContract]
        bool CreatePaymentPlatform(PaymentPlatform o);

        [OperationContract]
        bool UpdatePaymentPlatform(PaymentPlatform o);

        [OperationContract]
        bool DeletePaymentPlatform(int id);

        [OperationContract]
        PaymentPlatform GetPaymentPlatform(int id);

        [OperationContract]
        IList<PaymentPlatform> GetAllPaymentPlatform();

        #endregion

        #region UserRecharge
        [OperationContract]
        bool CreateUserRecharge(UserRecharge o, PayTrade trade);
        [OperationContract]
        bool UpdateUserRecharge(UserRecharge o);
        [OperationContract]
        int GetUserRechargeCount(long userId, byte? status = null);
        [OperationContract]
        int GetUserUsedPackageCount(long userId, int packageId);

        [OperationContract]
        bool DeleteUserRecharge(string id);
        [OperationContract]
        UserRecharge GetUserRecharge(string id);
        [OperationContract]
        IList<UserRecharge> GetAllUserRecharge();
        [OperationContract]
        PagedList<UserRecharge> GetPagedUserRecharge(long? userId, byte? status = null, string userName = null, int index = 1, int size = 20, DateTime? beginDate = null, DateTime? endDate = null);
        #endregion

        #region  RechargePackage

        [OperationContract]
        IList<RechargePackage> GetAllRechargePackage(bool? status = null, string name = null);
        #endregion

        #region PayTrade

        //[OperationContract]
        //bool CreatePayTrade(PayTrade o);

        [OperationContract]
        bool PayByBalance(PayTrade o);

        [OperationContract]
        bool UpdatePayTrade(PayTrade o);

        [OperationContract]
        PayTrade GetPayTrade(string id);
        #endregion
        [OperationContract]
        bool BidCurrencyIncrease(int userId, string username, int amount, bool free, int category, string associatedId,
                                 string extra, out string message);
    }
}